. . . 'Calculate the difference between mpg rats. LET IMPROVEMENT = MPG2 - MPG1 'Write out the result. PRINT "Your mileage improved by", IMPROVEMENT, " miles per gallon" END
Here is the complete program:
'Ask the user for the data. PRINT "Enter the first odometer reading" INPUT FIRSTMILES ' PRINT "Enter the second odometer reading" INPUT SECONDMILES ' PRINT "Enter the first gallons" INPUT GALLONS1 ' PRINT "Enter the third odometer reading" INPUT THIRDMILES ' PRINT "Enter the second gallons" INPUT GALLONS2 ' 'Calculate mpg for first tank of gas. LET MPG1 = (SECONDMILES - FIRSTMILES) / GALLONS1 'Calculate mpg for second tank of gas. LET MPG2 = (THIRDMILES - SECONDMILES) / GALLONS2 'Calculate the difference between mpg rates. LET IMPROVEMENT = MPG2 - MPG1 'Write out the result. PRINT "Your mileage improved by", IMPROVEMENT, " miles per gallon" END
Is it possible for IMPROVEMENT
to be negative?